<?php

class Soul_Util_Enviroment {

    public static function getPhpVersion(){
        return PHP_VERSION;
    }

    public static function isPhp52(){
        return substr(PHP_VERSION, 2, 1) == '2';
    }

    public static function isPhp53(){
        return substr(PHP_VERSION, 2, 1) == '3';
    }

    public static function getMagicQuotesGpc(){
        return get_magic_quotes_gpc();
    }
    
    public static function getMagicQuotesRuntime(){
        return get_magic_quotes_runtime();
    }    
    
    public static function extensionIsLoaded($name){
    	return extension_loaded($name);
    }
    
    public static function isApache(){
    	return strpos(strtolower(getenv('server_software')), 'apache') !== FALSE;
    }
    
    public static function isRewritable(){
    	if(self::isApache()){
    		$mods = apache_get_modules();
    		return in_array('mod_rewrite', $mods);
    	}
    	return FALSE;
    }
}